bitkeeper revision 1.1159.1.11 (41167ad4Yx3OUTmkAYwUL5rDLiIUbA)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Sun, 8 Aug 2004 19:11:16 +0000 (19:11 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Sun, 8 Aug 2004 19:11:16 +0000 (19:11 +0000)
It is safe for inter-dom event channels to still be bound during suspend.
Normal driver restart mechanisms will clean things up during resume.

linux-2.6.7-xen-sparse/arch/xen/kernel/evtchn.c

index 572732efda0fec501256befcc1eead3f73cf9924..057bd8ab48a345a5c0630ca83eec3804523f4bfb 100644 (file)
@@ -380,7 +380,7 @@ static struct irqaction misdirect_action = {
 
 void irq_suspend(void)
 {
-    int virq, irq, evtchn;
+    int pirq, virq, irq, evtchn;
 
     /* Unbind VIRQs from event channels. */
     for ( virq = 0; virq < NR_VIRQS; virq++ )
@@ -394,16 +394,13 @@ void irq_suspend(void)
         irq_to_evtchn[irq]    = -1;
     }
 
-    /*
-     * We should now be unbound from all event channels. Stale bindings to 
-     * PIRQs and/or inter-domain event channels will cause us to barf here.
-     */
-    for ( evtchn = 0; evtchn < NR_EVENT_CHANNELS; evtchn++ )
-        if ( evtchn_to_irq[evtchn] != -1 )
-            panic("Suspend attempted while bound to evtchn %d.\n", evtchn);
+    /* Check that no PIRQs are still bound. */
+    for ( pirq = 0; pirq < NR_PIRQS; pirq++ )
+        if ( (evtchn = irq_to_evtchn[pirq_to_irq(pirq)]) != -1 )
+            panic("Suspend attempted while PIRQ %d bound to evtchn %d.\n",
+                  pirq, evtchn);
 }
 
-
 void irq_resume(void)
 {
     evtchn_op_t op;